package com.df.happylearn.messages;

import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;

import com.df.happylearn.R;
import com.df.happylearn.activity.BaseActivity;
import com.df.happylearn.utils.ActivityUtils;

/**
 * Created by dingfeng on 2016/5/25.
 */
public class MessagesActivity extends BaseActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_messages);
        findViewById(R.id.back).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        MessagesFragment messagesFragment = (MessagesFragment)getSupportFragmentManager().findFragmentById(R.id.frameContent);
        if (messagesFragment == null) {
            messagesFragment = MessagesFragment.newInstance();
            ActivityUtils.addFragmentToActivity(getSupportFragmentManager(), messagesFragment, R.id.frameContent);
        }
        new MessagesPresenter(messagesFragment);
    }
}
